import { MANIFEST, renderContextMenu } from "../../util/chrome";
import { global_init } from "../../util/inits";
import { MessageType, sendMessage } from "../../util/message";

const title = MANIFEST.name
const url_main = new URL('/assets/html/main.html', location.origin).href

global_init()

function render () {
    renderContextMenu({
        title: `${title}`,
        children: [
            {
                title: '打开应用页面',
                onclick: () => {
                    open(url_main)
                },
            },
            {
                title: '运行content脚本',
                onclick: () => sendMessage(MessageType.CONTENT_START),
            },
        ]
    })
}

render()